<?php 
namespace app\index\model;
use think\Model;
use think\model\concern\SoftDelete;
/**
 * 
 */
class Card extends Model
{
    //软删除
    use SoftDelete;
    
    //激活模型
    function edit($data)
    {
        # code...
        $cardInfo=$this->find($data['id']);
        $cardInfo->cardstar_time=$data['cardstar_time'];
        $cardInfo->cardoverdue_time=$data['cardoverdue_time'];
        $result=$cardInfo->save();
        if($result){
            return 1;
        }else{
            return '写入开始时间出错';
        }

    }

    //机器码模型
    public function machin($data)
    {
        $cardInfo=$this->find($data['id']);
        $cardInfo->machine=$data['machine'];
        $result=$cardInfo->save();
        if($result){
            return 1;
        }else{
            return '写入机器码出错';
        }
    }


}